<?php if (!defined('THINK_PATH')) exit();?>

<!DOCTYPE html>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="__TMPL__Common/style/style.css" />
<script type="text/javascript" src="__TMPL__Common/js/check_dog.js"></script>
<script type="text/javascript" src="__TMPL__Common/js/IA300ClientJavascript.js"></script>
<script type="text/javascript">
	var ACTION_ID ='<?php echo $action_id ?>';
 	var VAR_MODULE = "<?php echo conf("VAR_MODULE");?>";
	var VAR_ACTION = "<?php echo conf("VAR_ACTION");?>";
	var MODULE_NAME	=	'<?php echo MODULE_NAME; ?>';
	var ACTION_NAME	=	'<?php echo ACTION_NAME; ?>';
	var ROOT = '__APP__';
	var ROOT_PATH = '<?php echo APP_ROOT; ?>';
	var CURRENT_URL = '<?php echo trim($_SERVER['REQUEST_URI']);?>';
	var INPUT_KEY_PLEASE = "<?php echo L("INPUT_KEY_PLEASE");?>";
	var TMPL = '__TMPL__';
	var APP_ROOT = '<?php echo APP_ROOT; ?>';
	var LOGINOUT_URL = '<?php echo u("Public/do_loginout");?>';
	var WEB_SESSION_ID = '<?php echo es_session::id(); ?>';
	var EMOT_URL = '<?php echo APP_ROOT; ?>/public/emoticons/';
	var MAX_FILE_SIZE = "<?php echo (app_conf("MAX_IMAGE_SIZE")/1000000)."MB"; ?>";
	var FILE_UPLOAD_URL ='<?php echo u("File/do_upload");?>' ;
	CHECK_DOG_HASH = '<?php $adm_session = es_session::get(md5(conf("AUTH_KEY"))); echo $adm_session["adm_dog_key"]; ?>';
	function check_dog_sender_fun()
	{
		window.clearInterval(check_dog_sender);
		check_dog2();
	}
	var check_dog_sender = window.setInterval("check_dog_sender_fun()",5000);
	
</script>
	<script type="text/javascript" src="__TMPL__Common/js/cropper/jquery.min.js"></script>
<script type="text/javascript" src="__TMPL__Common/js/jquery.timer.js"></script>

<link rel="stylesheet" type="text/css" href="__TMPL__Common/style/weebox.css" />
<script type="text/javascript" src="__TMPL__Common/js/jquery.bgiframe.js"></script>
<script type="text/javascript" src="__TMPL__Common/js/jquery.weebox.js"></script>
<link rel="stylesheet" type="text/css" href="__TMPL__Common/js/cropper/cropper.min.css" />
<link rel="stylesheet" type="text/css" href="__TMPL__Common/js/cropper/main.css" />
<script type="text/javascript" src="__TMPL__Common/js/cropper/cropper.min.js"></script>

<script type="text/javascript" src="__TMPL__Common/js/script.js"></script>
<script type="text/javascript" src="__ROOT__/public/runtime/admin/lang.js"></script>
<script type='text/javascript'  src='__ROOT__/admin/public/kindeditor/kindeditor.js'></script>
<script type='text/javascript'  src='__ROOT__/admin/public/kindeditor/lang/zh_CN.js'></script>


</head>
<body onLoad="javascript:DogPageLoad();">
<div id="info"></div>


<script type="text/javascript" src="__TMPL__Common/js/jquery.bgiframe.js"></script>
<script type="text/javascript" src="__TMPL__Common/js/jquery.weebox.js"></script>
<script type="text/javascript" src="__TMPL__Common/js/user.js"></script>
<script type="text/javascript" src="__TMPL__Common/js/deal.js"></script>
<link rel="stylesheet" type="text/css" href="__TMPL__Common/style/weebox.css" />
<div class="main">
<div class="main_title_list"><div class="list-line-ico"></div>靓号列表</div>
<?php function get_is_sales($tag,$id)
	{
		if($tag)
		{
			return "<span class='is_effect'>".l("IS_SALE_1")."</span>";
		}
		else
		{
			return "<span class='is_effect'>".l("IS_SALE_0")."</span>";
		}
	}

	function insert_or_edit($id,$tag)
	{
		if($tag)
		{
			return "已售出";
		}
		else
		{
			return "<a href='javascript:user_edit(".$id.");'>卖出</a>";
		}
	}

	function get_price($price,$id){
		return "<span onclick='set_price(".$id.",".$price.",this);'>".$price."</span>";
	} ?>

<script type="text/javascript">
	function user_edit(id){
		location.href = ROOT+"?"+VAR_MODULE+"=LuckNum&"+VAR_ACTION+"=edit&id="+id;
	}

	function set_price(id,price,domobj){
		$(domobj).html("<input type='text' value='"+price+"' id='set_price' class='require' />");
		$("#set_price").select();
		$("#set_price").focus();
		$("#set_price").bind("blur",function(){
			var newprice = $(this).val();
			$.ajax({
				url:ROOT+"?"+VAR_MODULE+"="+MODULE_NAME+"&"+VAR_ACTION+"="+"set_price"+"&id="+id+"&price="+newprice,
				dataType:"json",
				success:function(result){
					if (result.status) {
						$(domobj).html(newprice);
					}else{
						$(domobj).html(price);
					}
				}
			});
		});
	}

	//售出状态
//	function change_sale(id,domobj){
//		$.ajax({
//			url: ROOT+"?"+VAR_MODULE+"="+MODULE_NAME+"&"+VAR_ACTION+"=change_sale&id="+id,
//			data: "",
//			dataType: "json",
//			success: function(obj){
//				if(obj.data=='1')
//				{
//					$(domobj).html(LANG['IS_SALE_1']);
//				}
//				else if(obj.data=='0')
//				{
//					$(domobj).html(LANG['IS_SALE_0']);
//				}
//				else if(obj.data=='')
//				{
//
//				}
//				$("#info").html(obj.info);
//			}
//		});
//	}

</script>

<div class="search_row">
	<form name="search" action="__APP__" method="get">
		靓号ID：<input type="text" class="textbox" name="luck_num" value="<?php echo trim($_REQUEST['luck_num']);?>" style="width:100px;" />
		主播昵称：<input type="text" class="textbox" name="nick_name" value="<?php echo trim($_REQUEST['nick_name']);?>" style="width:100px;" />
        是否已卖出：<select name="is_sale">
        <option value="">全部</option>
        <option value="1" <?php if($_REQUEST['is_sale'] == 1): ?>selected="selected"<?php endif; ?>>是</option>
        <option value="0" <?php if($_REQUEST['is_sale']!='' && $_REQUEST['is_sale'] == 0): ?>selected="selected"<?php endif; ?>>否</option>
        </select>
		<input type="hidden" value="LuckNum" name="m" />
		<input type="hidden" value="index" name="a" />
		<input type="submit" class="button" value="<?php echo L("SEARCH");?>" />
	</form>
</div>
<!-- Think 系统列表组件开始 -->
<table id="dataTable" class="dataTable" cellpadding=0 cellspacing=0 ><tr><td colspan="7" class="topTd" ></td></tr><tr class="row" ><th width="8"><input type="checkbox" id="check" onclick="CheckAll('dataTable')"></th><th><a href="javascript:sortBy('luck_num','<?php echo ($sort); ?>','LuckNum','index')" title="按照<?php echo L("LUCK_NUM");?>   <?php echo ($sortType); ?> "><?php echo L("LUCK_NUM");?>   <?php if(($order)  ==  "luck_num"): ?><img src="__TMPL__Common/images/<?php echo ($sortImg); ?>.gif" width="12" height="17" border="0" align="absmiddle"><?php endif; ?></a></th><th><a href="javascript:sortBy('user_id','<?php echo ($sort); ?>','LuckNum','index')" title="按照用户id   <?php echo ($sortType); ?> ">用户id   <?php if(($order)  ==  "user_id"): ?><img src="__TMPL__Common/images/<?php echo ($sortImg); ?>.gif" width="12" height="17" border="0" align="absmiddle"><?php endif; ?></a></th><th><a href="javascript:sortBy('nick_name','<?php echo ($sort); ?>','LuckNum','index')" title="按照<?php echo L("NICK_NAME");?>   <?php echo ($sortType); ?> "><?php echo L("NICK_NAME");?>   <?php if(($order)  ==  "nick_name"): ?><img src="__TMPL__Common/images/<?php echo ($sortImg); ?>.gif" width="12" height="17" border="0" align="absmiddle"><?php endif; ?></a></th><th><a href="javascript:sortBy('is_sale','<?php echo ($sort); ?>','LuckNum','index')" title="按照<?php echo L("IS_SALE");?>   <?php echo ($sortType); ?> "><?php echo L("IS_SALE");?>   <?php if(($order)  ==  "is_sale"): ?><img src="__TMPL__Common/images/<?php echo ($sortImg); ?>.gif" width="12" height="17" border="0" align="absmiddle"><?php endif; ?></a></th><th><a href="javascript:sortBy('price','<?php echo ($sort); ?>','LuckNum','index')" title="按照售价<?php echo ($sortType); ?> ">售价<?php if(($order)  ==  "price"): ?><img src="__TMPL__Common/images/<?php echo ($sortImg); ?>.gif" width="12" height="17" border="0" align="absmiddle"><?php endif; ?></a></th><th width="60px">操作</th></tr><?php if(is_array($list)): $i = 0; $__LIST__ = $list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$luck_num): ++$i;$mod = ($i % 2 )?><tr class="row" ><td><input type="checkbox" name="key" class="key" value="<?php echo ($luck_num["id"]); ?>"></td><td><?php echo ($luck_num["luck_num"]); ?></td><td><?php echo ($luck_num["user_id"]); ?></td><td><?php echo ($luck_num["nick_name"]); ?></td><td><?php echo (get_is_sales($luck_num["is_sale"],$luck_num['id'])); ?></td><td><?php echo (get_price($luck_num["price"],$luck_num['id'])); ?></td><td class="op_action"> <?php echo (insert_or_edit($luck_num["id"],$luck_num['is_sale'])); ?>&nbsp;</td></tr><?php endforeach; endif; else: echo "" ;endif; ?><tr><td colspan="7" class="bottomTd"> &nbsp;</td></tr></table>
<!-- Think 系统列表组件结束 -->

	<table class="dataTable">
		<tbody>
			<td colspan="5">
				<input type="button" class="button button-add" value="<?php echo L("ADD");?>" onclick="add();" /><input type="button" class="button button-del" value="<?php echo L("DEL");?>" onclick="foreverdel();" />
			</td>
		</tbody>
	</table>
<div class="page"><?php echo ($page); ?></div>
</div>
</body>
</html>